/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fwdisp.analyser;

import java.util.ArrayList;
import java.util.Arrays;

/**
 *
 * @author Admin
 */
public class NauenAnalyser extends BasicAnalyser{
    
       
    
    public NauenAnalyser(String input)
    {
        setInput(input);
        //find really AusrueckSetting:
        AusrueckAnalyser ausrueckAnalyser = new AusrueckAnalyser(input);
        setOrdnung(ausrueckAnalyser.getFirstMatchingARO());
        
        
        //parts to remove:
        String[] remove = { "\\(NUL\\)", 
                            "\\*.*\\*" //removing Date
        };
        
        //parts to replace:
        String[][] replace = {
            {",,", ","},
            {",", ", "},
            {"Nauen/Nauen", "Nauen"}
        };
                
        
        //removing:
        for (String regex: remove)
            input = input.replaceAll(regex, "");
        
        //replacing:
        for (String[] repl: replace)
        {
            input = input.replaceAll(repl[0], repl[1]);
        }
        
        if (input.split("//").length > 1)
            setEtxt(input.split("//")[1]);
        else
            setEtxt("");
        
        
        ArrayList<String> input_split = new ArrayList<String>(Arrays.asList(input.split("//")[0].split(" ")));
        
        //getting e_nr
        setEnr(input_split.get(0));
        
        
        String eOrt = "";
        
        for (int i = 3; i < input_split.size(); i++)
            eOrt = eOrt + " " + input_split.get(i);
        
        setEort(eOrt);
                
        //System.out.println("input after removing/replacing: \n" + input   );
    }
}
